﻿#pragma once

#include "pch.h"
#include "core/Macro.h"
#include "function/EventSystem/Event.h"
// #include "GLFW/glfw3.h"

namespace Engine
{
	struct WindowProps
	{
		std::string Title;
		unsigned int Width;
		unsigned int Height;

		explicit WindowProps(std::string title = "Mini Game Engine", const unsigned int width = 1920, const unsigned int height = 1080)
			:Title(std::move(title)), Width(width), Height(height)
		{}
	};

	/// <summary>
	/// 抽象窗口，每个平台分别实现
	/// </summary>
	class ENGINE_API AbstractWindow
	{
	public:
		virtual ~AbstractWindow() = default;

		using EventCallBack = std::function<void(Event&)>;

		virtual void OnUpdate() = 0;
		virtual bool ShouldClose() const = 0;

		virtual unsigned int GetWidth() const = 0;
		virtual unsigned int GetHeight() const = 0;

		virtual void SetEventCallback(const EventCallBack& callback) = 0;
		virtual void SetVSync(bool enabled) = 0;
		virtual bool IsVSync() const = 0;

		static AbstractWindow* Create(const WindowProps& props = WindowProps());

		virtual void* GetNativeWindow() const = 0;

		// todo:添加设置标题方法
		virtual void SetWindowTitle(const char* title) = 0;
	};
}

